function [ allCarsMatrix ] = ReadAllCars
%READALLCARS Summary of this function goes here
%   Creat Matrix with All Cars, Features from external Function and Set the
%   label to 1 (Cars).
% Labels1 : 1 for Cars, 2 for Sport2, 3 for SUVs and 4 for Trucks
% Labels2 : 10 for Back pose, 11 for Side pose and 12 for Front pose

%javaaddpath('C:\Program Files (x86)\Weka-3-7\weka.jar')
clear
load('vehicles_shortest.mat');
javaaddpath('C:\Program Files\Weka-3-6\weka.jar')


allCarsMatrix = zeros(1008,257);
 % First 252 images are for     Truck     , Label 1
 allCarsMatrix(1:252,2) = 1;
 % Second 252 images are for    Cars  , Label 2
allCarsMatrix(253:504,2) = 2;
% Third 252 images are for      SUV's   , Label 3
allCarsMatrix(505:756,2) = 3;
% Fourth 252 images are for     Sports  , Label 4
allCarsMatrix(757:1008,2) = 4;
%intImageNumber=1;
%class = cell(1008,1);
%i= 1;
%while(i < 1009)
%%    class(i:i+2,1) = {'10'};
%    class(i+3:i+5,1) = {'11'};
%    class(i+6:i+8,1) = {'12'};
%    i = i +9 ;
%end    

for i=1:1008
    
    for k=1:127
      allCarsMatrix(i,k+2) =vehicles(i).selected_hog_features(k); 
      allCarsMatrix(i,k+129) =(vehicles(i).selected_wave_features(k)');
    end     
end
 
%for i=1:1008
    %allCarsMatrix(i,2) = i ;
   %allCarsMatrix(i,5:132)= vehicles(i).selected_hog_features;
            
%end
intViechleNo = 0 ;
intImageCounter = 1;
   while ( intImageCounter < 1009)
       
       % Initilize all pictures numbers in first verctor of the matrix
       %allCarsMatrix(intImageCounter,1)= intImaeNumber;
       
       % 112 Viechles, each has a number ( 1 - 112) V2, a type ( 1 - 4) V6
       % and 3 poses ( 10, 11 12) V7.
       % allCarsMatrix(intImageCounter : intImageCounter+8,2)= intViechleNo;
       % Viechle poses from 1 - 3 are for       Back Poses    , Label 10
       allCarsMatrix(intImageCounter : intImageCounter+2,257)= -10;
       % Viechle poses from 1 - 3 are for       Front Poses   , Label 11
       allCarsMatrix(intImageCounter+3 : intImageCounter+5,257)= -11;
       % Viechle poses from 1 - 3 are for       Side Poses    , Label 12
       allCarsMatrix(intImageCounter+6 : intImageCounter+8,257)= -12;
       intImageCounter = intImageCounter +9;   
       intViechleNo = intViechleNo +1 ;
   end
   KFold(allCarsMatrix); 
end
   
           
